package com.dctp.common.db;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

public class RiskMetricDb {
    public static Record findByUserId(Long userId) {
        return Db.findFirst("SELECT * FROM dctp_risk_metric WHERE user_id = ? AND enabled = 1", userId);
    }
    public static void update(Long id, Record metric) {
        Db.update("dctp_risk_metric", "id", metric);
    }
    public static void delete(Long id) {
        Db.update("DELETE FROM dctp_risk_metric WHERE id = ?", id);
    }
}
